public class Day_15_2_手套 {
    //get
    public int findMinimum(int n, int[] left, int[] right) {
        // write code here
        int sum = 0;
        int ls = 0;
        int rs = 0;
        int lmin = 27;
        int rmin = 27;
        for(int i = 0; i < n; i++) {
            if(left[i] * right[i] == 0) {
                sum += left[i] + right[i];
            }else {
                ls += left[i];
                rs += right[i];
                lmin = Math.min(lmin, left[i]);
                rmin = Math.min(rmin, right[i]);
            }
        }
        return sum + Math.min(ls - lmin + 1, rs - rmin + 1) + 1;
    }
}
